package com.victualler.core.config.permission.controller;

import com.victualler.core.base.controller.BaseRestController;
import com.victualler.core.common.dto.PageDto;
import com.victualler.core.config.permission.dto.PermissionGroupDto;
import com.victualler.core.config.permission.dto.request.PermissionRequestDto;
import com.victualler.core.config.permission.entity.PermissionInfoDao;
import com.victualler.core.config.permission.repository.PermissionInfoQueryRepository;
import com.victualler.core.config.permission.repository.PermissionInfoRepository;
import com.victualler.core.config.permission.service.PermissionInfoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author: Guoshichang
 * @discription:
 */
public interface PermissionInfoController  extends BaseRestController<PermissionInfoDao,PermissionInfoRepository,PermissionInfoQueryRepository,PermissionInfoService> {
    /**
     * @author Guoshichang   
     * @since 13:39 on 2018/7/7.
     * @param PermissionRequestDto
     * @Function  根据条件入参PermissionRequestDto动态分页查询权限
     */
    public PageDto<PermissionInfoDao> getByRequestDto(PermissionRequestDto PermissionRequestDto, int from , int limit);

    /**
     * @author Guoshichang
     * @since 16:30 on 2018/8/28.
     * @param name 权限名称
     * @return List
     * @Function 根据权限名称模糊查询
     */
    @RequestMapping("/getByName")
    public List<PermissionInfoDao> getByName(@RequestParam("name") String name);

    @RequestMapping("/getByRoleId")
    public PermissionGroupDto getByRoleId(@RequestParam("roleId") Long roleId);
}
